Integrand size = 29, antiderivative size = 243 \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 (A+B \cos (c+d x)) \, dx=\frac {1}{8} \left (12 a^2 A b+3 A b^3+4 a^3 B+9 a b^2 B\right ) x+\frac {\left (15 a^3 A b+60 a A b^3-3 a^4 B+52 a^2 b^2 B+16 b^4 B\right ) \sin (c+d x)}{30 b d}+\frac {\left (30 a^2 A b+45 A b^3-6 a^3 B+71 a b^2 B\right ) \cos (c+d x) \sin (c+d x)}{120 d}+\frac {\left (15 a A b-3 a^2 B+16 b^2 B\right ) (a+b \cos (c+d x))^2 \sin (c+d x)}{60 b d}+\frac {(5 A b-a B) (a+b \cos (c+d x))^3 \sin (c+d x)}{20 b d}+\frac {B (a+b \cos (c+d x))^4 \sin (c+d x)}{5 b d} \]
[Out]
Time = 0.41 (sec) , antiderivative size = 243, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {3047, 3102, 2832, 2813} \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 (A+B \cos (c+d x)) \, dx=\frac {\left (-3 a^2 B+15 a A b+16 b^2 B\right ) \sin (c+d x) (a+b \cos (c+d x))^2}{60 b d}+\frac {\left (-6 a^3 B+30 a^2 A b+71 a b^2 B+45 A b^3\right ) \sin (c+d x) \cos (c+d x)}{120 d}+\frac {1}{8} x \left (4 a^3 B+12 a^2 A b+9 a b^2 B+3 A b^3\right )+\frac {\left (-3 a^4 B+15 a^3 A b+52 a^2 b^2 B+60 a A b^3+16 b^4 B\right ) \sin (c+d x)}{30 b d}+\frac {(5 A b-a B) \sin (c+d x) (a+b \cos (c+d x))^3}{20 b d}+\frac {B \sin (c+d x) (a+b \cos (c+d x))^4}{5 b d} \]
[In]
[Out]
Rule 2813
Rule 2832
Rule 3047
Rule 3102
Rubi steps \begin{align*} \text {integral}& = \int (a+b \cos (c+d x))^3 \left (A \cos (c+d x)+B \cos ^2(c+d x)\right ) \, dx \\ & = \frac {B (a+b \cos (c+d x))^4 \sin (c+d x)}{5 b d}+\frac {\int (a+b \cos (c+d x))^3 (4 b B+(5 A b-a B) \cos (c+d x)) \, dx}{5 b} \\ & = \frac {(5 A b-a B) (a+b \cos (c+d x))^3 \sin (c+d x)}{20 b d}+\frac {B (a+b \cos (c+d x))^4 \sin (c+d x)}{5 b d}+\frac {\int (a+b \cos (c+d x))^2 \left (b (15 A b+13 a B)+\left (15 a A b-3 a^2 B+16 b^2 B\right ) \cos (c+d x)\right ) \, dx}{20 b} \\ & = \frac {\left (15 a A b-3 a^2 B+16 b^2 B\right ) (a+b \cos (c+d x))^2 \sin (c+d x)}{60 b d}+\frac {(5 A b-a B) (a+b \cos (c+d x))^3 \sin (c+d x)}{20 b d}+\frac {B (a+b \cos (c+d x))^4 \sin (c+d x)}{5 b d}+\frac {\int (a+b \cos (c+d x)) \left (b \left (75 a A b+33 a^2 B+32 b^2 B\right )+\left (30 a^2 A b+45 A b^3-6 a^3 B+71 a b^2 B\right ) \cos (c+d x)\right ) \, dx}{60 b} \\ & = \frac {1}{8} \left (12 a^2 A b+3 A b^3+4 a^3 B+9 a b^2 B\right ) x+\frac {\left (15 a^3 A b+60 a A b^3-3 a^4 B+52 a^2 b^2 B+16 b^4 B\right ) \sin (c+d x)}{30 b d}+\frac {\left (30 a^2 A b+45 A b^3-6 a^3 B+71 a b^2 B\right ) \cos (c+d x) \sin (c+d x)}{120 d}+\frac {\left (15 a A b-3 a^2 B+16 b^2 B\right ) (a+b \cos (c+d x))^2 \sin (c+d x)}{60 b d}+\frac {(5 A b-a B) (a+b \cos (c+d x))^3 \sin (c+d x)}{20 b d}+\frac {B (a+b \cos (c+d x))^4 \sin (c+d x)}{5 b d} \\ \end{align*}
Time = 2.31 (sec) , antiderivative size = 176, normalized size of antiderivative = 0.72 \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 (A+B \cos (c+d x)) \, dx=\frac {60 \left (12 a^2 A b+3 A b^3+4 a^3 B+9 a b^2 B\right ) (c+d x)+60 \left (8 a^3 A+18 a A b^2+18 a^2 b B+5 b^3 B\right ) \sin (c+d x)+120 \left (3 a^2 A b+A b^3+a^3 B+3 a b^2 B\right ) \sin (2 (c+d x))+10 b \left (12 a A b+12 a^2 B+5 b^2 B\right ) \sin (3 (c+d x))+15 b^2 (A b+3 a B) \sin (4 (c+d x))+6 b^3 B \sin (5 (c+d x))}{480 d} \]
[In]
[Out]
Time = 3.95 (sec) , antiderivative size = 176, normalized size of antiderivative = 0.72
method | result | size |
parts | \(\frac {\left (A \,b^{3}+3 B a \,b^{2}\right ) \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}+\frac {\left (3 A a \,b^{2}+3 B \,a^{2} b \right ) \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3 d}+\frac {\left (3 A \,a^{2} b +B \,a^{3}\right ) \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {a^{3} A \sin \left (d x +c \right )}{d}+\frac {B \,b^{3} \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5 d}\) | \(176\) |
parallelrisch | \(\frac {120 \left (3 A \,a^{2} b +A \,b^{3}+B \,a^{3}+3 B a \,b^{2}\right ) \sin \left (2 d x +2 c \right )+10 \left (12 A a \,b^{2}+12 B \,a^{2} b +5 B \,b^{3}\right ) \sin \left (3 d x +3 c \right )+15 \left (A \,b^{3}+3 B a \,b^{2}\right ) \sin \left (4 d x +4 c \right )+6 B \,b^{3} \sin \left (5 d x +5 c \right )+60 \left (8 A \,a^{3}+18 A a \,b^{2}+18 B \,a^{2} b +5 B \,b^{3}\right ) \sin \left (d x +c \right )+720 x \left (A \,a^{2} b +\frac {1}{4} A \,b^{3}+\frac {1}{3} B \,a^{3}+\frac {3}{4} B a \,b^{2}\right ) d}{480 d}\) | \(179\) |
derivativedivides | \(\frac {\frac {B \,b^{3} \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5}+A \,b^{3} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+3 B a \,b^{2} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+A a \,b^{2} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )+B \,a^{2} b \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )+3 A \,a^{2} b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+B \,a^{3} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+A \,a^{3} \sin \left (d x +c \right )}{d}\) | \(227\) |
default | \(\frac {\frac {B \,b^{3} \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5}+A \,b^{3} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+3 B a \,b^{2} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+A a \,b^{2} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )+B \,a^{2} b \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )+3 A \,a^{2} b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+B \,a^{3} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+A \,a^{3} \sin \left (d x +c \right )}{d}\) | \(227\) |
risch | \(\frac {3 x A \,a^{2} b}{2}+\frac {3 x A \,b^{3}}{8}+\frac {a^{3} B x}{2}+\frac {9 x B a \,b^{2}}{8}+\frac {a^{3} A \sin \left (d x +c \right )}{d}+\frac {9 \sin \left (d x +c \right ) A a \,b^{2}}{4 d}+\frac {9 \sin \left (d x +c \right ) B \,a^{2} b}{4 d}+\frac {5 \sin \left (d x +c \right ) B \,b^{3}}{8 d}+\frac {B \,b^{3} \sin \left (5 d x +5 c \right )}{80 d}+\frac {\sin \left (4 d x +4 c \right ) A \,b^{3}}{32 d}+\frac {3 \sin \left (4 d x +4 c \right ) B a \,b^{2}}{32 d}+\frac {\sin \left (3 d x +3 c \right ) A a \,b^{2}}{4 d}+\frac {\sin \left (3 d x +3 c \right ) B \,a^{2} b}{4 d}+\frac {5 \sin \left (3 d x +3 c \right ) B \,b^{3}}{48 d}+\frac {3 \sin \left (2 d x +2 c \right ) A \,a^{2} b}{4 d}+\frac {\sin \left (2 d x +2 c \right ) A \,b^{3}}{4 d}+\frac {\sin \left (2 d x +2 c \right ) B \,a^{3}}{4 d}+\frac {3 \sin \left (2 d x +2 c \right ) B a \,b^{2}}{4 d}\) | \(278\) |
norman | \(\frac {\left (\frac {3}{2} A \,a^{2} b +\frac {3}{8} A \,b^{3}+\frac {1}{2} B \,a^{3}+\frac {9}{8} B a \,b^{2}\right ) x +\left (15 A \,a^{2} b +\frac {15}{4} A \,b^{3}+5 B \,a^{3}+\frac {45}{4} B a \,b^{2}\right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (15 A \,a^{2} b +\frac {15}{4} A \,b^{3}+5 B \,a^{3}+\frac {45}{4} B a \,b^{2}\right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {3}{2} A \,a^{2} b +\frac {3}{8} A \,b^{3}+\frac {1}{2} B \,a^{3}+\frac {9}{8} B a \,b^{2}\right ) x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {15}{2} A \,a^{2} b +\frac {15}{8} A \,b^{3}+\frac {5}{2} B \,a^{3}+\frac {45}{8} B a \,b^{2}\right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {15}{2} A \,a^{2} b +\frac {15}{8} A \,b^{3}+\frac {5}{2} B \,a^{3}+\frac {45}{8} B a \,b^{2}\right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {4 \left (45 A \,a^{3}+75 A a \,b^{2}+75 B \,a^{2} b +29 B \,b^{3}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{15 d}+\frac {\left (8 A \,a^{3}-12 A \,a^{2} b +24 A a \,b^{2}-5 A \,b^{3}-4 B \,a^{3}+24 B \,a^{2} b -15 B a \,b^{2}+8 B \,b^{3}\right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {\left (8 A \,a^{3}+12 A \,a^{2} b +24 A a \,b^{2}+5 A \,b^{3}+4 B \,a^{3}+24 B \,a^{2} b +15 B a \,b^{2}+8 B \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {\left (48 A \,a^{3}-36 A \,a^{2} b +96 A a \,b^{2}-3 A \,b^{3}-12 B \,a^{3}+96 B \,a^{2} b -9 B a \,b^{2}+16 B \,b^{3}\right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}+\frac {\left (48 A \,a^{3}+36 A \,a^{2} b +96 A a \,b^{2}+3 A \,b^{3}+12 B \,a^{3}+96 B \,a^{2} b +9 B a \,b^{2}+16 B \,b^{3}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{5}}\) | \(564\) |
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 174, normalized size of antiderivative = 0.72 \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 (A+B \cos (c+d x)) \, dx=\frac {15 \, {\left (4 \, B a^{3} + 12 \, A a^{2} b + 9 \, B a b^{2} + 3 \, A b^{3}\right )} d x + {\left (24 \, B b^{3} \cos \left (d x + c\right )^{4} + 120 \, A a^{3} + 240 \, B a^{2} b + 240 \, A a b^{2} + 64 \, B b^{3} + 30 \, {\left (3 \, B a b^{2} + A b^{3}\right )} \cos \left (d x + c\right )^{3} + 8 \, {\left (15 \, B a^{2} b + 15 \, A a b^{2} + 4 \, B b^{3}\right )} \cos \left (d x + c\right )^{2} + 15 \, {\left (4 \, B a^{3} + 12 \, A a^{2} b + 9 \, B a b^{2} + 3 \, A b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{120 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 551 vs. \(2 (241) = 482\).
Time = 0.30 (sec) , antiderivative size = 551, normalized size of antiderivative = 2.27 \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 (A+B \cos (c+d x)) \, dx=\begin {cases} \frac {A a^{3} \sin {\left (c + d x \right )}}{d} + \frac {3 A a^{2} b x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {3 A a^{2} b x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {3 A a^{2} b \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} + \frac {2 A a b^{2} \sin ^{3}{\left (c + d x \right )}}{d} + \frac {3 A a b^{2} \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac {3 A b^{3} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 A b^{3} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 A b^{3} x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {3 A b^{3} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {5 A b^{3} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} + \frac {B a^{3} x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {B a^{3} x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {B a^{3} \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} + \frac {2 B a^{2} b \sin ^{3}{\left (c + d x \right )}}{d} + \frac {3 B a^{2} b \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac {9 B a b^{2} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {9 B a b^{2} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {9 B a b^{2} x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {9 B a b^{2} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {15 B a b^{2} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} + \frac {8 B b^{3} \sin ^{5}{\left (c + d x \right )}}{15 d} + \frac {4 B b^{3} \sin ^{3}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{3 d} + \frac {B b^{3} \sin {\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (A + B \cos {\left (c \right )}\right ) \left (a + b \cos {\left (c \right )}\right )^{3} \cos {\left (c \right )} & \text {otherwise} \end {cases} \]
[In]
[Out]
none
Time = 0.21 (sec) , antiderivative size = 217, normalized size of antiderivative = 0.89 \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 (A+B \cos (c+d x)) \, dx=\frac {120 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B a^{3} + 360 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a^{2} b - 480 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B a^{2} b - 480 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} A a b^{2} + 45 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} B a b^{2} + 15 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} A b^{3} + 32 \, {\left (3 \, \sin \left (d x + c\right )^{5} - 10 \, \sin \left (d x + c\right )^{3} + 15 \, \sin \left (d x + c\right )\right )} B b^{3} + 480 \, A a^{3} \sin \left (d x + c\right )}{480 \, d} \]
[In]
[Out]
none
Time = 0.32 (sec) , antiderivative size = 188, normalized size of antiderivative = 0.77 \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 (A+B \cos (c+d x)) \, dx=\frac {B b^{3} \sin \left (5 \, d x + 5 \, c\right )}{80 \, d} + \frac {1}{8} \, {\left (4 \, B a^{3} + 12 \, A a^{2} b + 9 \, B a b^{2} + 3 \, A b^{3}\right )} x + \frac {{\left (3 \, B a b^{2} + A b^{3}\right )} \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} + \frac {{\left (12 \, B a^{2} b + 12 \, A a b^{2} + 5 \, B b^{3}\right )} \sin \left (3 \, d x + 3 \, c\right )}{48 \, d} + \frac {{\left (B a^{3} + 3 \, A a^{2} b + 3 \, B a b^{2} + A b^{3}\right )} \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} + \frac {{\left (8 \, A a^{3} + 18 \, B a^{2} b + 18 \, A a b^{2} + 5 \, B b^{3}\right )} \sin \left (d x + c\right )}{8 \, d} \]
[In]
[Out]
Time = 0.90 (sec) , antiderivative size = 277, normalized size of antiderivative = 1.14 \[ \int \cos (c+d x) (a+b \cos (c+d x))^3 (A+B \cos (c+d x)) \, dx=\frac {3\,A\,b^3\,x}{8}+\frac {B\,a^3\,x}{2}+\frac {3\,A\,a^2\,b\,x}{2}+\frac {9\,B\,a\,b^2\,x}{8}+\frac {A\,a^3\,\sin \left (c+d\,x\right )}{d}+\frac {5\,B\,b^3\,\sin \left (c+d\,x\right )}{8\,d}+\frac {A\,b^3\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {B\,a^3\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {A\,b^3\,\sin \left (4\,c+4\,d\,x\right )}{32\,d}+\frac {5\,B\,b^3\,\sin \left (3\,c+3\,d\,x\right )}{48\,d}+\frac {B\,b^3\,\sin \left (5\,c+5\,d\,x\right )}{80\,d}+\frac {3\,A\,a^2\,b\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {A\,a\,b^2\,\sin \left (3\,c+3\,d\,x\right )}{4\,d}+\frac {3\,B\,a\,b^2\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {B\,a^2\,b\,\sin \left (3\,c+3\,d\,x\right )}{4\,d}+\frac {3\,B\,a\,b^2\,\sin \left (4\,c+4\,d\,x\right )}{32\,d}+\frac {9\,A\,a\,b^2\,\sin \left (c+d\,x\right )}{4\,d}+\frac {9\,B\,a^2\,b\,\sin \left (c+d\,x\right )}{4\,d} \]
[In]
[Out]